<?php
// $this->caseInfo
// $this->caseFHinfo
// $this->caseFDinfo

#	Zend_Debug::dump($this->caseInfo);
#	exit(0);

	$decedent_full_name = $this->caseInfo['decedent_fname'];
	$decedent_full_name .= " ".$this->caseInfo['decedent_mname'];
	$decedent_full_name .= " ".$this->caseInfo['decedent_lname'];
	
	$funeral_home_name = $this->caseFHinfo['name'];
	$funeral_home_address = $this->caseFHinfo['addr1'];
	$funeral_home_city = $this->caseFHinfo['city'];
	$funeral_home_state = $this->caseFHinfo['state'];
	$funeral_home_zip = $this->caseFHinfo['zip'];
	$funeral_home_phone = $this->caseFHinfo['phone'];
	$funeral_home_url = $this->caseFHinfo['url'];
	
	$arranger_name = $this->arranger['full_name'];
	$arranger_phone = $this->caseFHinfo['phone'];
	$arranger_email = $this->caseFHinfo['primary_email'];
	$arranger_cell_phone = $this->user_profile['phone'];

	$visitation_date = $this->caseInfo['visitation_date'];
	$visitation_time = $this->caseInfo['visitation_time'];
	$service_date = $this->caseInfo['service_date'];
	$service_time = $this->caseInfo['service_time'];
	$service_adviser_name = $this->caseInfo['family_advisor_name'];
	$service_adviser_phone = $this->caseInfo['family_advisor_phone'];
	$service_adviser_cell_phone = $this->caseInfo['family_advisor_cell_phone'];

	$service_location = $this->caseInfo['service_loc'];

	$cemetery_name = $this->caseInfo['cemetery_name'];
	$cemetery_address = $this->caseInfo['cemetery_address'];
	$cemetery_city = $this->caseInfo['cemetery_city'];
	$cemetery_state = $this->caseInfo['cemetery_state'];
	$cemetery_state = $this->caseInfo['cemetery_zip'];
	$cemetery_phone = $this->caseInfo['cemetery_phone']; // don't think this is coming over in the case record
	$cemetery_contact_name = $this->caseInfo['cemetery_contact_name'];
	
	# just guessing here.
	$church_name = $this->caseInfo['church'];
	$church_address = $this->caseInfo['church_street'];
	$church_citystatezip = $this->caseInfo['church_citystatezip'];
	
	$things_to_bring = stripslashes($this->caseInfo['things_to_bring']);
	
	$florist_name = $this->caseInfo['florist'];
	$arrangement_str = $this->caseInfo['arrangement'];

	$floral_arrangements = array();
	if(!empty($arrangement_str))
	{
		$arrangement_xml = simplexml_load_string($arrangement_str);
		foreach( $arrangement_xml as $collection)
		{
			$floral_arrangements[] = array( "name"=>"".$collection->name, "price"=>"".$collection->price );
		}
	}

	$paper_stock = $this->caseInfo['paper_stock_category'];
	$verse = $this->caseInfo['verse'];
	
	// set these up in the controller method
	$caterer_name = $this->caseInfo['caterer'];
	$caterer_name = stripslashes($caterer_name);
	$caterer_name = str_replace(":", "", $caterer_name);
	$caterer_name = stripslashes($caterer_name);
	$caterer_name = str_replace( ":", "", $caterer_name);
	$gathering_location = $this->caseInfo['location'];
	
	$gathering_address = "";
	$gathering_city = "";
	$gathering_state = "";
	$gathering_zip = "";
	
	$gathering_description = $this->caseInfo['catering_notes'];	
	$gatering_location = $this->caseInfo['location'];
	$gathering_date_time = $this->caseInfo['datetime'];
	list($gathering_date, $gathering_time) = explode(" ", $gathering_date_time);
	$menu = $this->caseInfo['menu'];
	
	$cash_advances = $this->cash_advance_items;	// get from controller method
	
	$primary_contact_name = $this->caseInfo['contact_fname']." ".$this->caseInfo['contact_mname']." ".$this->caseInfo['contact_lname'];
	$primary_contact_address = $this->caseInfo['contact_address'];
	$primary_contact_city = $this->caseInfo['contact_city'];
	$primary_contact_state = $this->caseInfo['contact_state'];
	$primary_contact_phone = $this->caseInfo['contact_phone'];
	$primary_contact_email = $this->caseInfo['contact_email'];
	
	$secondary_contact_name = $this->caseInfo['secondary_contact_name'];
	$secondary_contact_address = $this->caseInfo['secondary_contact_address'];
	$secondary_contact_city = $this->caseInfo['secondary_contact_city'];
	$secondary_contact_state = $this->caseInfo['secondary_contact_state'];
	$secondary_contact_phone = $this->caseInfo['secondary_contact_phone'];
	$secondary_contact_email = $this->caseInfo['secondary_contact_email'];
	
	$paid_in_full = $this->caseInfo['paid_in_full'];
	$funding_opt = trim($this->caseInfo['funding_option']);
	$funding_option_codes = explode(" ", $funding_opt);
	
	$funding_options = "<ul>";
	foreach( $funding_option_codes as $code )
	{
		if(isset(Financials::$_paymentOptions[$code]) && 
		  !empty(Financials::$_paymentOptions[$code]))
			$funding_options .= "<li>".Financials::$_paymentOptions[$code]."</li>";
	}
	$funding_options .= "</ul>";
	
	$paper_stock = $this->caseInfo['paper_stock_category'];
	$verse = $this->caseInfo['verse'];
	$things_to_bring = stripslashes($this->caseInfo['things_to_bring']);
	
	$contract_number = $this->caseInfo['FDMS_case_num'];
 ?>
 
<script language="JavaScript">
	var gAutoPrint = true; // Tells whether to automatically call the print function
	function printSpecial()
		{
		if (document.getElementById != null)
			{
			var html = '<HTML>\n<HEAD>\n';
			if (document.getElementsByTagName != null)
				{
				var headTags = document.getElementsByTagName("head");
				if (headTags.length > 0)
				html += headTags[0].innerHTML;
				}

			html += '\n</HE>\n<BODY>\n';
			var printReadyElem = document.getElementById("printReady");
			if (printReadyElem != null)
				{
				html += printReadyElem.innerHTML;
				}
				else
				{
				alert("Could not find the printReady function");
				return;
				}

			html += '\n</BO>\n</HT>';
			var printWin = window.open("","printSpecial");
			printWin.document.open();
			printWin.document.write(html);
			printWin.document.close();
			if (gAutoPrint)
			printWin.print();
		}
		else
		{
		alert("The print ready feature is only available if you are using an browser. Please update your browser.");
		}
	}
</script>
<div class="standard" id="printReady">

	<div style="width:100%;text-align:center">
	<h1>FAMILY ITINERARY</h1>
	</div>
	<br>

	<div style="width:100%;text-align:center">
	<h1> SERVICE DETAILS FOR: <?php echo $decedent_full_name?></h1>
	</div>
	<br><br>

	<div class="iblock">
	<fieldset><legend>Funeral Home</legend>
	<span style="font-weight:bold"><?php echo $funeral_home_name?></span><br>
	<?php echo $funeral_home_address?><br>
	<?php echo $funeral_home_city?>, <?php echo $funeral_home_state?>&nbsp;&nbsp;<?php echo $funeral_home_zip?><br>
	<?php echo $funeral_home_phone?><br>
	<?php echo $funeral_home_website?><br>
	<span style="font-weight:bold">Your Arranger:<br><?php echo $arranger_name?></span><br>
	Phone: <?php echo $arranger_phone?><br>
	<!-- Alt. Phone: <?php echo $arranger_cell_phone?><br> -->
	Email: <?php echo $arranger_email?><br>
	</fieldset>
	</div>

	<div  class="iblock">
	<fieldset><legend>Visitation &amp; Service</legend>
	<span style="font-weight:bold">Visitation Date: <?php echo $visitation_date?></span><br>
	<span style="font-weight:bold">Visitation Time: <?php echo $visitation_time?></span><br>
	<span style="font-weight:bold">Service Date: <?php echo $service_date?></span><br>
	<span style="font-weight:bold">Service Time: <?php echo $service_time?></span><br>
	<span style="font-weight:bold">Service Location: <br><pre style="margin-left:15px;"><?php echo $service_location ?></pre></span><br>
	</fieldset>
	</div>

	<br clear="all">

	<!-- <div class="iblock">
	<fieldset><legend>Your Arranger</legend><span style="font-weight:bold"><?php echo $arranger_name?></span><br>
	Phone: <?php echo $arranger_phone?><br>
	<!-- Alt. Phone: <?php echo $arranger_cell_phone?><br>
	<!-- Email: <?php echo $arranger_email?><br> 
	</fieldset>
	</div> -->

	<div class="iblock">
	<fieldset><legend>Family Service Advisor</legend>
	<span style="font-weight:bold">Name:</span> <?php echo $service_adviser_name?><br>
	<span style="font-weight:bold">Phone:</span> <?php echo $service_adviser_phone?><br>
	<!--<span style="font-weight:bold">Cell Phone:</span> <?php echo $service_adviser_cell_phone?><br>-->
	</fieldset>
	</div>
	
	<div class="iblock">
	<fieldset><legend>Paper Stock / Verse</legend>
	<?php echo  $paper_stock ?> / <?php echo  $verse ?>
	</fieldset>
	<br>
	</div>
	
		<br clear="all">
		
	<div class="iblock">
	<fieldset><legend>Cemetery</legend>
	<span style="font-weight:bold"><?php echo $cemetery_name?></span><br>
	<?php echo $cemetery_address?><br>
	<?php echo $cemetery_city?>, <?php echo $cemetery_state?>&nbsp;<?php echo $cemetery_zip?><br><br>
	Phone Number: <?php echo $cemetery_phone?><br>
	Contact: <?php echo $cemetery_contact_name?><br>
	Service Time: <?php echo $service_time?><br>
	</fieldset>
	</div>
	
	
	<div class="iblock" style="width:385px;">
	<fieldset><legend>Things to Bring/Remember</legend>
	<pre><?php echo $things_to_bring?></pre>
	</fieldset>
	</div>

	<br clear="all">

	<div class="iblock">
	<fieldset><legend>Florist</legend>
	<?php echo stripslashes($florist_name)?><br><br>
	Selections:<br>
	<?php
	foreach( $floral_arrangements as $arrangement )
	{
		echo $arrangement['name']."<br>";
	}
	 ?>
	</fieldset>
	</div>
	
	<div class="iblock">
	<fieldset><legend>Gathering</legend>
	<!-- <span style="font-weight:bold">Gathering</span><br> -->
	Caterer: <?php echo stripslashes($caterer_name)?><br>
	Date: <?php echo $gathering_date ?><br>
	Time: <?php echo $gathering_time ?><br>
	Location: <pre style="margin-left:15px;"><?php echo $gathering_location ?></pre>
	Phone Number: <?php echo $funeral_home_phone?><br>
	Contact: <?php echo  $arranger_name ?><br>

	<?php
	// write out $arrangements
	 ?>
	</fieldset>
	</div>

<br clear="all">

	<div class="iblock">
	<fieldset><legend>Payments to be Made</legend>
	<?php
	echo "<table border=0 cellpadding=4>\n";
	echo "<tr><th>Item Description</th><th>Amount</th></tr>\n";
	foreach( $cash_advances as $advance )
	{
		echo "<tr><td>{$advance['item_description']}</td><td>\${$advance['item_amount']}<td></tr>\n";
	}
	echo "</table>";
	 ?>
	</fieldset>
	</div>

	<div class="iblock">
	<fieldset><legend>Method of Payment</legend>
	<?php
	// display method of payment
		echo $funding_options."<br>";
		if($paid_in_full) echo "Paid In Full";
	 ?>
	</fieldset>
	</div>

<br clear="all">

	<div class="iblock">
	<fieldset><legend>Family Contact (Primary)</legend>
	Name: <?php echo  $primary_contact_name ?><br>
	<!-- Address:<br><?php echo  $primary_contact_address ?><br>
	<?php echo  $primary_contact_city ?>, <?php echo  $primary_contact_state ?> <?php echo  $primary_contact_zip ?><br> -->
	Phone Number: <?php echo  $primary_contact_phone ?><br>
	Email: <?php echo  $primary_contact_email ?><br>
	</fieldset>
	</div>

	<div class="iblock">
	<fieldset><legend>Family Contact (Secondary)</legend>
	Name: <?php echo  $secondary_contact_name ?><br>
	<!-- Address:<br><?php echo  $secondary_contact_address ?><br>
	<?php echo  $secondary_contact_city ?>, <?php echo  $secondary_contact_state ?> <?php echo  $secondary_contact_zip ?><br> -->
	Phone Number: <?php echo  $secondary_contact_phone ?><br>
	Email: <?php echo  $secondary_contact_email ?><br>
	</fieldset>
	</div>

<br clear="all">

	<div class="iblock">
	<fieldset><legend>Helpful Websites</legend>
	Funeral Home:<br> <a href="<?php echo  $funeral_home_url ?>"><?php echo  $funeral_home_url ?></a><br>
	Memorial Solutions:<br> <a href="http://www.memorialsolutions.net" target="_blank">http://www.memorialsolutions.net</a><br>
	Social Security Administration:<br> <a href="http://www.ssa.gov" target="_blank">http://www.ssa.gov</a><br>
	Veterans Funeral Care:<br> <a href="http://www.veteransfuneralcare.com" target="_blank">http://www.veteransfuneralcare.com</a><br>
	Key Memories:<br> <a href="http://www.keymemories.com" target="_blank">http://www.keymemories.com</a><br>
	</fieldset>
	</div>
	
	<div class="iblock">
	<fieldset><legend>Information</legend>
	<span style="font-weight:bold">To order additional copies of the following:</span><br>
	&nbsp;&nbsp;Death Certificates<br>
	&nbsp;&nbsp;Remembrance Items<br>
	&nbsp;&nbsp;Paper Products<br>
	&nbsp;&nbsp;Planning in Advance Information<br>
	<b>Contact:</b> <?php echo $funeral_home_phone?><br>
	</fieldset>
	</div>
	
	
	<!-- <div class="iblock">
	<span style="font-weight:bold">To order additional copies of the following:</span><br>
	&nbsp;&nbsp;Death Certificates<br>
	&nbsp;&nbsp;Remembrance Items<br>
	&nbsp;&nbsp;Paper Products<br>
	&nbsp;&nbsp;Planning in Advance Information<br>
	<b>Contact:</b> <?php echo $funeral_home_phone?><br>
	</div> -->

	<!-- <div class="iblock">
	<span style="font-weight:bold">Contract Number:</span> <?php echo $this->caseInfo['FDMS_case_num'] ?><br>
	<br><br>
	<span style="font-weight:bold">Arranger Checklist:</span> <a href="http://www.keymemsol.com/keystone/VAS/public/arranger_check_list.pdf" target="_blank">open file</a><br>
	<span style="font-weight:bold">Catering Order Form:</span> <a href="http://www.keymemsol.com/keystone/VAS/public/index/cateringorderform/case_number/<?php echo $this->caseInfo['FDMS_case_num'] ?>" target="_blank">open file</a><br>
	<span style="font-weight:bold">Floral Order Form:</span> <a href="http://www.keymemsol.com/keystone/VAS/public/index/floralorderform/case_number/<?php echo $this->caseInfo['FDMS_case_num'] ?>" target="_blank">open file</a><br>
	</div> -->

	<!-- <div class="iblock">
	<span style="font-weight:bold">General Notes:</span> <?php echo stripslashes($this->caseInfo['general_note']) ?><br>
	</div> -->


</div>

	
	
<br clear="all">
<div class="iblock" style="margin-left:10px;">
	<span style="font-weight:bold">Contract Number:</span> <?php echo $this->caseInfo['FDMS_case_num'] ?><br>
	<span style="font-weight:bold">Arranger Checklist:</span> <a href="http://www.keymemsol.com/keystone/VAS/public/arranger_check_list.pdf" target="_blank">open file</a><br>
	<span style="font-weight:bold">Catering Order Form:</span> <a href="http://www.keymemsol.com/keystone/VAS/public/index/cateringorderform/case_number/<?php echo $this->caseInfo['FDMS_case_num'] ?>" target="_blank">open file</a><br>
	<span style="font-weight:bold">Floral Order Form:</span> <a href="http://www.keymemsol.com/keystone/VAS/public/index/floralorderform/case_number/<?php echo $this->caseInfo['FDMS_case_num'] ?>" target="_blank">open file</a><br>
	</div>
<br clear="all">
<a href="javascript:void(printSpecial())"><img src="../art/btn_print.jpg" border="0" style="float:left;"></a>
